using UnityEngine;
using System.Collections;

public class waterTrigger : MonoBehaviour {

	public float waterDamage;
	public GameObject ParticlePrefab;
	
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnTriggerStay (Collider collider) {
		if (collider.gameObject.tag == "Player") {
			collider.GetComponent<PlayerWControl>().decreaseHealth(waterDamage);
			Destroy(Instantiate(ParticlePrefab, collider.transform.position, collider.transform.rotation), 0.5f);
		}
	}
}
